<template>
	<view style="position: relative; z-index: 999;" id="tabbar">
		<up-tabbar :value="props.current" activeColor="#4E96E9" inactiveColor="#AAAAAA">
			<up-tabbar-item text="首页" @click='changeRouter(0)'>
				<template #active-icon>
					<image style="width: 50rpx;height: 50rpx;" src="https://ryyf.wangjintech.cn/static/image/common/7.png">
					</image>
				</template>
				<template #inactive-icon>
					<image style="width: 50rpx;height: 50rpx;" src="https://ryyf.wangjintech.cn/static/image/common/10.png">
					</image>
				</template>
			</up-tabbar-item>
			<up-tabbar-item text="攻略" @click='changeRouter(1)'>
				<template #active-icon>
					<image style="width: 50rpx;height: 50rpx;" src="https://ryyf.wangjintech.cn/static/image/common/8.png">
					</image>
				</template>
				<template #inactive-icon>
					<image style="width: 50rpx;height: 50rpx;" src="https://ryyf.wangjintech.cn/static/image/common/11.png">
					</image>
				</template>
			</up-tabbar-item>
			<up-tabbar-item text="积分商城" @click='changeRouter(2)'>
				<template #active-icon>
					<image style="width: 50rpx;height: 50rpx;" src="https://ryyf.wangjintech.cn/static/image/common/0013.png">
					</image>
				</template>
				<template #inactive-icon>
					<image style="width: 50rpx;height: 50rpx;" src="https://ryyf.wangjintech.cn/static/image/common/0014.png">
					</image>
				</template>
			</up-tabbar-item>
			<up-tabbar-item text="我的" @click='changeRouter(3)'>
				<template #active-icon>
					<image style="width: 50rpx;height: 50rpx;" src="https://ryyf.wangjintech.cn/static/image/common/9.png">
					</image>
				</template>
				<template #inactive-icon>
					<image style="width: 50rpx;height: 50rpx;" src="https://ryyf.wangjintech.cn/static/image/common/12.png">
					</image>
				</template>
			</up-tabbar-item>
		</up-tabbar>
	</view>
</template>

<script setup>
	import {
		msg,
		notLogged
	} from "@/utils/tool.js"
	const emit = defineEmits(["login"])
	const props = defineProps({
		current: {
			type: Number,
			default: 0
		}
	})

	// 路由
	const routerMap = new Map([
		[0, "/pages/index/index"],
		[1, "/pages/strategy/index"],
		[2, "/pages/integral/index"],
		[3, "/pages/mine/index"],
	])

	// 跳转
	const changeRouter = index => {
		uni.redirectTo({
			url: routerMap.get(index)
		})
	}
</script>

<style lang="scss" scoped>
</style>